home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 6: Level 6 / 17 Bit - Level 6 (1998)(Epic Marketing)[!].iso / quartz / q0429.dms / q0429.adf / etc / malloc.sgi < prev    next >
Text File  |  1991-08-08  |  2KB  |  54 lines

  1. [ Mike Gigante notes that when rendering exteremely large datasets
  2.   (consisting primarily of triangles in his case), one may use the
  3.   'mallopt()' routine on certain machines to improve performance
  4.   significantly (to say the least). -- CEK ]
  5.   
  6.  
  7. From mg@godzilla.cgl.rmit.OZ.AU  Tue Aug 21 14:35:08 1990
  8. Received: from godzilla.cgl.rmit.oz.au by weedeater.math.yale.edu via SMTP; Tue, 21 Aug 90 14:35:08 -0400
  9. Received: by godzilla 
  10. Date: Wed, 22 Aug 90 05:16:40 EST
  11. From: mg@godzilla.cgl.rmit.OZ.AU (Mike Gigante)
  12. Message-Id: <9008211916.4715@godzilla>
  13. To: craig@weedeater.math.yale.edu
  14. Subject: malloc stuff
  15. Status: RO
  16.  
  17. Craig,
  18. we spoke after the ray tracing sig about malloc stuff. Here is that
  19. stuff I promised to send you. 
  20.  
  21. 1) include <malloc.h> in your main program
  22. 2) make the following code the *first* executable statements
  23.  
  24. #ifdef sgi
  25.   /*
  26.    * try to tune the malloc stuff. First thing to note is that most
  27.    * allocated blocks (at least for triangles) are less than 200 bytes...
  28.    */
  29.   mallopt(M_MXFAST, 200);
  30.   /*
  31.    * allocate a big chunk at a time - esp since we are going to use LOTS
  32.    * of memory!
  33.    */
  34.   mallopt(M_BLKSZ, 65536);
  35.   /*
  36.    * don't try too hard when looking for free'd memory to re-use. This
  37.    * avoids the heavy paging penalty we have seen... In fact don't look
  38.    * at all!
  39.    */
  40.   mallopt(M_MXCHK, 0);
  41. #endif
  42.  
  43. and wow! *HUGE* improvments for large models. Just to remind you, it was
  44. a difference of 88 min CPU time over 10 hour period (just to read a model)
  45. vs about 2 minutes cpu/elapsed. Because of the M_MXCHK call, the working
  46. set was larger but it didn't make much difference..
  47.  
  48. BTW, you should check the 200 bytes in the M_MXFAST call. Make it larger
  49. than the common malloc sizes (say for mallocing triangle/poly structs).
  50.  
  51. Hope this is useful.
  52.  
  53. Mike Gigante, RMIT
  54.